<template>
<div>
  <html>
  <title>课程表</title>
  <head></head>
  <body  v-loading="loading">
  <table v-if="timetable.length>0" border = 6 frame = void align = center width = 850px height = 100px cellspacing = 0px cellpadding = 10px>
    <tr height = 50px align = center style="color: red">
      <th width = 110px ></th><th>星期一</th><th>星期二</th><th>星期三</th><th>星期四</th><th>星期五</th>
    </tr>
    <tr height = 40px align = center>
      <td ></td><td colspan = 5 color = red><b>上午</b></td>
    </tr>
    <tr height = 40px align = center>
      <td ><b>一</b><br>08:35-09:20</td><td>{{timetable[0][0]}}</td><td>{{timetable[1][0]}}</td><td>{{timetable[2][0]}}</td><td>{{timetable[3][0]}}</td><td>{{timetable[4][0]}}</td>
    </tr>
    <tr height = 40px align = center>
      <td ><b>二</b><br>14:00-14:45</td><td>{{timetable[0][1]}}</td><td>{{timetable[1][1]}}</td><td>{{timetable[2][1]}}</td><td>{{timetable[3][1]}}</td><td>{{timetable[4][1]}}</td>
    </tr>
    <tr height = 40px align = center>
      <td ><b>三</b><br>14:50-15:35</td><td>{{timetable[0][2]}}</td><td>{{timetable[1][2]}}</td><td>{{timetable[2][2]}}</td><td>{{timetable[3][2]}}</td><td>{{timetable[4][2]}}</td>
    </tr>
    <tr height = 40px align = center>
      <td ></td><td colspan = 5 ><b>下午</b></td>
    </tr>
    <tr height = 40px align = center>
      <td ><b>四</b><br>15:50-17:25</td><td>{{timetable[0][3]}}</td><td>{{timetable[1][3]}}</td><td>{{timetable[2][3]}}</td><td>{{timetable[3][3]}}</td><td>{{timetable[4][3]}}</td>
    </tr>
    <tr height = 40px align = center>
      <td ><b>五</b><br>18:30-20:05</td><td>{{timetable[0][4]}}</td><td>{{timetable[1][4]}}</td><td>{{timetable[2][4]}}</td><td>{{timetable[3][4]}}</td><td>{{timetable[4][4]}}</td>
    </tr>
  </table>

  </body>

  </html>
</div>
</template>

<script>
export default {
  name: "ClassInfo",
  data(){
    return{
      timetable:[],
      loading :true
    }
  },
  created() {
    let classId = JSON.parse(sessionStorage.getItem("user")).classId;

    this.getRequest('/getTimetable?classId='+classId).then(resp=>{
     this.timetable = resp.data.data
    })

    this.loading = false
  }
}
</script>

<style scoped>

</style>